// component/authorizePage/authorizePage.js
const app = getApp();
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    authorizationPopup: true
  },

  /**
   * 组件的方法列表
   */
  methods: {
    // 关闭微信授权引导弹框
    authorizationPopupClose() {
      this.setData({
        authorizationPopup: false
      })
    },
    authorizeClick() {
      let that = this
      that.setData({
        authorizationPopup: false
      })
      app.getLogin((res) => {
        if (!res) {
          if (wx.getUserProfile) {
            app.getUserProfile(function(){
              that.setData({
                getPhoneNumberData:{
                  isShowGetPhoneNumber:true
                }
              })
            })
          } else {
            if(!wx.getStorageSync('loginMsg').bindingPhone){
              that.setData({
                getPhoneNumberData:{
                  isShowGetPhoneNumber:true
                }
              })
            }
          }
        }
      })
    },
  }
})
